Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add custom Menu component #75

Conversation

mkarajohn
Copy link
Contributor

@mkarajohn mkarajohn commented Oct 10, 2023

Resolves DSTRBTN-540

Generated summary (powered by Graphite)

TL;DR

This pull request introduces a new Menu component in the authentication module. The Menu component is a dropdown menu that can be used to display a list of options to the user. It includes a button that toggles the visibility of the menu and a tag that can be used to display additional information.

What changed

Three new files were added in the authentication/components/Menu directory:

  1. Menu.style.ts: This file contains the styled components used in the Menu component. It includes styles for the wrapper, button, tag, and option elements.

  2. Menu.tsx: This is the main file for the Menu component. It uses the styled components from Menu.style.ts and includes the logic for toggling the visibility of the menu and handling option selection.

  3. index.ts: This file exports the Menu component for use in other parts of the application.

How to test

To test this change, you can import the Menu component into any component in the authentication module and use it as follows:

import Menu from './Menu';

<Menu
  items={['Option 1', 'Option 2', 'Option 3']}
  onSelect={(option) => console.log(option)}
  buttonText="More"
  tagText="Tag"
/>

This will render a button labeled "More" and a tag labeled "Tag". Clicking on the button will toggle the visibility of a menu with the options "Option 1", "Option 2", and "Option 3". Selecting an option will log the selected option to the console.

Why make this change

This change was made to provide a reusable Menu component that can be used to display a list of options to the user. This can be useful in a variety of scenarios, such as providing a list of actions that the user can perform on a particular item.

Copy link
Contributor Author

mkarajohn commented Oct 10, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@mkarajohn mkarajohn force-pushed the 10-09-chore_fix_eslint_and_ts_errors_in_dev_and_introduce_tsconfig.prod.ts_file branch from 988fc42 to 3754372 Compare October 16, 2023 23:37
@mkarajohn mkarajohn force-pushed the 10-10-feat_add_custom_Menu_component branch from 2469f9c to 630bf2d Compare October 16, 2023 23:37
@orfium-sonarqube-app
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 0.0% 0.0% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

@mkarajohn mkarajohn merged commit 630bf2d into 10-09-chore_fix_eslint_and_ts_errors_in_dev_and_introduce_tsconfig.prod.ts_file Oct 24, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants